package com.ljy.my_study.commons;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/** 
* @author James
* @date 2018年2月1日 
*/
public class Gift {
	public static void main(String[] args) throws Exception {
//		File file=new File("C:\\Users\\hasee\\Desktop\\奖品.txt");
//		FileInputStream fis=new FileInputStream(file);
//		InputStream is=Gift.class.getResourceAsStream("C:\\Users\\hasee\\Desktop\\奖品.txt");
//		BufferedReader br=new BufferedReader(new InputStreamReader(fis));
//		String line=null;
//		
//		String[] arr=new String[2];
//		
//		try {
//			StringBuilder sb=new StringBuilder();
//			while((line=br.readLine())!=null) {
////				sb.append(line+"\n");
//				arr=line.split("\\s+");
////				System.out.println(arr[0]+","+arr[1]);
//				sb.append("{\""+arr[0]+"\",\""+arr[1]+"\"},\n");
//			}
//			System.out.println(sb.toString());
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		List<Map<String,String>> barrageVOList=new ArrayList<>();
		String[][] barrages= {
				{"Harriet","20元红包"},
				{"Kelly","150元红包"},
				{"卡尔","150元红包"},
				{"Oliver","20元红包"},
				{"Abraham","150元红包"},
				{"西蒙","澳门上网卡一张"},
				{"阿尔瓦","10元红包"},
				{"Karen","50元红包"},
				{"Leo","100元红包"},
				{"Albert","5元红包"},
				{"给姐笑一個","50元红包"},
				{"身上有wifi","100元红包"},
				{"Andrew","10元红包"},
				{"Alex","200元红包"},
				{"Diego","澳门上网卡一张"},
				{"格伦","20元红包"},
				{"月老","5元红包"},
				{"Carl","10元红包"},
				{"Larissa","50元红包"},
				{"Lance","50元红包"},
				{"Nick","100元红包"},
				{"Anthony","200元红包"},
				{"孟婆","150元红包"},
				{"莪煮魚i","200元红包"},
				{"Aidan","10元红包"},
				{"Easter","澳门上网卡一张"},
				{"Gwendolyn","5元红包"},
				{"Tankard","150元红包"},
				{"人丑多读书","澳门上网卡一张"},
				{"利奥","5元红包"},
				{"幼儿园学霸","50元红包"},
				{"兰斯","200元红包"},
				{"Charles","50元红包"},
				{"Aaron","100元红包"},
				{"亚伦","澳门上网卡一张"},
				{"Caiden","200元红包"},
				{"Evan","澳门上网卡一张"},
				{"埃尔维斯","5元红包"},
				{"卡洛斯","100元红包"},
				{"Jacquelyn","200元红包"},
				{"Leon","100元红包"},
				{"心中的小鹿","100元红包"},
				{"嘴贱欠吻","20元红包"},
				{"猪肉涨价","200元红包"},
				{"儿子拼个爸","5元红包"},
				{"艾润","10元红包"},
				{"Warren","澳门上网卡一张"},
				{"Carlos","200元红包"},
				{"Bill","10元红包"},
				{"Alva","150元红包"},
				{"Carl","50元红包"},
				{"Alonso","50元红包"},
				{"Joyce","20元红包"},
				{"Ben","5元红包"},
				{"Andy","150元红包"},
				{"Allen","10元红包"},
				{"Abel","100元红包"},
				{"奥利弗","10元红包"},
				{"Kevin","澳门上网卡一张"},
				{"凯文","200元红包"},
				{"睡觉的猫","20元红包"},
				{"埃文","50元红包"},
				{"懒得聪明","100元红包"},
				{"柔情似水","20元红包"},
				{"Elvis","200元红包"},
				{"Glen","50元红包"},
				{"安迪","20元红包"},
				{"Irene","150元红包"},
				{"Edith","5元红包"},
				{"卖萌的小行家","150元红包"},
				{"Edwin","澳门上网卡一张"},
				{"暗恋小怪兽","10元红包"},
				{"Simon","5元红包"},
				{"Easter","20元红包"},
				{"Bear熊老大","10元红包"},
				{"小毛虾","小肥《不再孤单演唱会》VIP区门票（两张）"},
				{"Baby baby","澳门旅游塔观光+蹦极笨猪跳门票"},
				{"哒啦啦666","10元红包"},
				{"喵喵猫","金光飞航香港往返澳门船票"},
				{"是不是傻","美高梅Teamlab未来游乐园门票"},
				{"小公举","20元红包"},
				{"Tommy","100元红包"},
				{"L远望那颗星","10元红包"},
				{"泰迪","150元红包"},
				{"最爱小肥","200元红包"},
				{"曾簧谇jwgC","10元红包"},
				{"James","100元红包"},
				{"游戏专用小马甲","10元红包"},
				{"Harry","100元红包"},
				{"甄幸运","50元红包"},
				{"Mac知足常乐","10元红包"},
				{"戏梦萌边","20元红包"},
				{"Lucky","10元红包"},
		};
		Set<Integer> set=new HashSet<>();
		while(set.size()<20) {
			for(int i=0;i<(20-set.size());i++) {
//				int ran=RandomUtils.nextInt(0, barrages.length);
				int ran=(int)(Math.random()*(barrages.length));
				set.add(ran);
			}
		}
		System.out.println("size:"+set.size());
		for(Integer s:set) {
			if(s==null) continue;
			System.out.println(barrages[s][0]+","+barrages[s][1]);
		}
	}
}
